import javax.media.jai.*;
import javax.swing.JFrame;


public class suavizarImagem {

	public suavizarImagem() {
		
	}

	public static void main(String[] args) {
		PlanarImage imagem = JAI.create("fileload", "matheus.jpg");
		float [] kernelMatriz = {	1f/25f, 1f/25f, 1f/25f, 1f/25f, 1f/25f, 
									1f/25f, 1f/25f, 1f/25f, 1f/25f, 1f/25f, 
									1f/25f, 1f/25f, 1f/25f, 1f/25f, 1f/25f, 
									1f/25f, 1f/25f, 1f/25f, 1f/25f, 1f/25f, 
									1f/25f, 1f/25f, 1f/25f, 1f/25f, 1f/25, };
		
		KernelJAI kernel = new KernelJAI(5, 5, kernelMatriz);
		PlanarImage bordas = JAI.create("convolve", imagem, kernel);
		JFrame frame = new JFrame();
		frame.add(new janelasSincronas(imagem, bordas));
		frame.pack();
		frame.setVisible(true);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
							

	}

}
